﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;

namespace TJ_MainNameSpace
{
    public partial class Peizhi3 : Form
    {
        public Peizhi3()
        {
            InitializeComponent();
        }
        //MySqlConnection con = new MySqlConnection(new MySQLConnectionString(TongJi_EMS.Properties.Settings.Default["server"].ToString(), TongJi_EMS.Properties.Settings.Default["database"].ToString(), TongJi_EMS.Properties.Settings.Default["mysqluser"].ToString(), TongJi_EMS.Properties.Settings.Default["mysqlpassword"].ToString(), shujuyuan3.port).AsString);
        MySqlConnection con = new MySqlConnection(TongJi_EMS.Properties.Settings.Default.monitorConnection);


        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            con.Open();
            //MySqlCommand setchar = new MySqlCommand(@"set names gb2312", con);
            //setchar.ExecuteNonQuery();
            string sql = "INSERT INTO dbpoint(db_address) VALUES('" + textBox .Text  + "')";

            MySqlCommand mInsertCmd = new MySqlCommand(sql, con);
            mInsertCmd.CommandType = CommandType.Text;

            mInsertCmd.ExecuteNonQuery();
            con.Close();

        }
    }
}